Jamie Munro - Knockout.js. Building Dynamic Client-Side Web Applications by 2014

Jamie Munro - Knockout.js. Building Dynamic Client-Side Web Applications by 2014

Author:2014
Format: epub
Published: 0101-01-01T00:00:00+00:00


Example 6-2. textarea bound to TinyMCE

<!DOCTYPE html> <html><head> <title>Data Binding with KnockoutJS</title> </head> <body> <form> <textarea data-bind="tinymce: htmlText"></textarea> </form> <button type="button" data-bind="click: resetContent">Reset content</button> <h2>Preview</h2> <div data-bind="html: htmlText"></div> <script type='text/javascript' src='js/jquery.js'></script> <script type='text/javascript' src='js/tinymce/jquery.tinymce.min.js'></script> <script type='text/javascript' src='js/tinymce/tinymce.min.js'></script> <script type='text/javascript' src='js/knockout-3.2.0.js'></script> <script type='text/javascript' src='js/kobinding.js'></script> <script> function ViewModel() { var self = this; self.htmlText = ko.observable(); self.resetContent = function() { self.htmlText(''); }; }; var viewModel = new ViewModel(); ko.applyBindings(viewModel); </script> </body> </html>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.